Redux, useSelector, useDispatch


用 hooks 取代 connect

connect => hooks
取資料: mapStateToProps => useSelector
更新資料: mapDispatchToProps => useDispatch

import { Provider, useSelector, useDispatch } from 'react-redux';
import { addTodo } from './action/todolist';







你可能感興趣的文章

[Day 4] JS in Pipeline (4): Configs and Secrets

[Day 4] JS in Pipeline (4): Configs and Secrets

RNN 進化了 - LSTM 與 GRU

RNN 進化了 - LSTM 與 GRU

用 TLA+ 幫你驗證系統規格設計

用 TLA+ 幫你驗證系統規格設計






留言討論